import 'package:flutter/material.dart';
import 'package:interview/theme/app_colors.dart';


class AppThemes {
  // 亮色主题
  static final ThemeData lightTheme = ThemeData(
    brightness: Brightness.light,
    primaryColor: Colors.blue,
    scaffoldBackgroundColor: Colors.white,
    appBarTheme: const AppBarTheme(
      backgroundColor: Colors.blue,
      foregroundColor: Colors.white,
    ),
    textTheme: const TextTheme(
      bodyLarge: TextStyle(color: Colors.black),
      bodyMedium: TextStyle(color: Colors.black87),
    ),
    elevatedButtonTheme: ElevatedButtonThemeData(
      style: ElevatedButton.styleFrom(
        foregroundColor: Colors.white,
        backgroundColor: Colors.blue,
      ),
    ),
    textButtonTheme: TextButtonThemeData(
      style: ButtonStyle(
        foregroundColor: WidgetStateProperty.resolveWith((states) {
          // 设置按钮文字颜色
          if (states.contains(WidgetState.disabled)) {
            return Colors.grey; // 禁用状态颜色
          }
          return const Color.fromARGB(255, 16, 44, 66); // 默认文字颜色
        }),
        overlayColor: WidgetStateProperty.resolveWith((states) {
          // 设置按钮点击时的背景效果
          if (states.contains(WidgetState.pressed)) {
            return const Color.fromARGB(255, 16, 44, 66).withOpacity(0.1);
          }
          return null;
        }),
      ),
    ),
    // 扩展主题  
    extensions: const [
      AppColors(
        subjectPure: Color(0xFFffffff),
        subjectMix1: Color(0xFFf3f5f7),
        subjectMix2: Color.fromARGB(255, 240, 239, 243),
        subjectMix3: Color.fromARGB(255, 216, 237, 241),

        contrastPure: Color(0xFF000000),
        contrastMix1: Color(0xff949398),
        contrastMix2:Color.fromARGB(255, 245, 255, 248),
        contrastMix3:Color.fromARGB(255, 30, 30, 30),

        textColour1: Colors.orange,
      )
    ]
  );

  // 暗色主题
  static final ThemeData darkTheme = ThemeData(
    brightness: Brightness.dark,
    primaryColor: Colors.grey[900],
    scaffoldBackgroundColor: Colors.black,
    appBarTheme: AppBarTheme(
      backgroundColor: Colors.grey[900],
      foregroundColor: Colors.white,
    ),
    textTheme: const TextTheme(
      bodyLarge: TextStyle(color: Colors.white),
      bodyMedium: TextStyle(color: Colors.white70),
    ),
    elevatedButtonTheme: ElevatedButtonThemeData(
      style: ElevatedButton.styleFrom(
        foregroundColor: Colors.grey[800],
        backgroundColor: Colors.white,
      ),
    ),
    textButtonTheme: TextButtonThemeData(
      style: ButtonStyle(
        foregroundColor: WidgetStateProperty.resolveWith((states) {
          // 设置按钮文字颜色
          if (states.contains(WidgetState.disabled)) {
            return Colors.grey; // 禁用状态颜色
          }
          return const Color.fromARGB(255, 246, 252, 255); // 默认文字颜色
        }),
        overlayColor: WidgetStateProperty.resolveWith((states) {
          // 设置按钮点击时的背景效果
          if (states.contains(WidgetState.pressed)) {
            return const Color.fromARGB(255, 246, 252, 255).withOpacity(0.1);
          }
          return null;
        }),
      ),
    ),
    extensions: const [
      AppColors(
        subjectPure: Color.fromARGB(255, 0, 0, 0),
        subjectMix1: Color.fromARGB(255, 10, 10, 10),
        subjectMix2:  Color.fromARGB(255, 20, 20, 20),
        subjectMix3: Color.fromARGB(255, 10, 12, 24),
        contrastPure: Color(0xFFFFFFFF),
        contrastMix1: Color(0xff6b6c67),
        contrastMix2: Color(0xFF11120D),
        contrastMix3:Color.fromARGB(255, 225, 225, 225),
        textColour1: Color.fromARGB(255, 120, 30, 130),
      )
    ],
  );
}
